package mapper

import (
	"gin-epg/internal/app/dao"
	"gin-epg/internal/app/entity"
)

/*
* 根据 name 查询 EpgChannelAlias
 */
func GetUserByName(name string) (user *entity.User, err error) {
	// 初始化 epgChannelAlias 变量
	user = new(entity.User)

	// 执行查询
	if err = dao.SqlSession.Where("username=?", name).First(user).Error; err != nil {
		return nil, err
	}
	return user, nil
}
